package com.dlut.java;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int count = n;
        int[] op = new int[m];
        boolean[] flag = new boolean[n + 1];
        for (int i = 0; i < m; i++) {
            op[i] = in.nextInt();
        }
        for (int i = m-1; i >= 0; i--) {
            if (!flag[op[i]]){
                flag[op[i]] = true;
                System.out.print(op[i]);
                count --;
                if (count > 0){
                    System.out.print(" ");
                }
            }
        }
        for (int i = 1; i <= n; i++) {
            if (!flag[i]){
                System.out.print(i);
                count --;
                if (count > 0){
                    System.out.print(" ");
                }
            }
        }
    }
}
